package custom;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.qianfeng.lingshijia.R;

import utils.DownloadUtils;

/**
 * Created by Mr.xingkong on 2016/1/13.
 */
public class Commody_secKill extends LinearLayout
{
    Context context;
    ImageView seckill_picture;
    TextView seckill_nowPrice,seckill_OriginPrice,secKill_name;
    public TextView limitNum,willStart;

    public Commody_secKill(Context context)
    {
        super(context);
        this.context = context;
        initView();
    }

    public Commody_secKill(Context context, AttributeSet attrs)
    {
        super(context, attrs);
        this.context = context;
        initView();
    }

    private void initView()
    {
        LayoutInflater.from(context).inflate(R.layout.commodity_seckill,this);
        secKill_name = (TextView) findViewById(R.id.secKill_name);
        seckill_picture = (ImageView) findViewById(R.id.seckill_picture);
        seckill_nowPrice = (TextView) findViewById(R.id.seckill_nowPrice);
        seckill_OriginPrice = (TextView) findViewById(R.id.seckill_OriginPrice);

         limitNum = (TextView) findViewById(R.id.limitNum_tv);
         willStart = (TextView) findViewById(R.id.willStart_tv);

    }

    public void setData(String imageUrl,String price,String originPrice,String title)
    {
        DownloadUtils.LoadPicture(imageUrl, seckill_picture);
        secKill_name.setText(title);
        seckill_OriginPrice.setText(originPrice);
        seckill_nowPrice.setText(price);

    }
}
